package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by bilibili on 2017/4/18.
 */
@Entity
public class AreaDetail implements Serializable {
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @GenericGenerator(name="auto-identity",strategy="identity")
    @Column(updatable = false, columnDefinition="BIGINT(19) COMMENT '自提地点详情'")
    private java.lang.Long id;

    @Column(columnDefinition="VARCHAR(100) COMMENT '地点'")
    private java.lang.String detailPlace;

    private  java.lang.String areaCode;

    private  java.lang.Integer status;
    /**
     * @备注:创建时间
     * @字段:gmt_datetime DATETIME(19)
     */
    @Column(updatable = false, columnDefinition="DATETIME(19) COMMENT '创建时间'")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private java.util.Date gmtDatetime = new java.util.Date();

    /**
     * @备注:修改时间
     * @字段:upt_datetime DATETIME(19)
     */
    @Column(columnDefinition="DATETIME(19) COMMENT '修改时间'")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private java.util.Date uptDatetime = new java.util.Date();



    @Transient
    private OpenArea openArea;//开通地点






    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDetailPlace() {
        return detailPlace;
    }

    public void setDetailPlace(String detailPlace) {
        this.detailPlace = detailPlace;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getGmtDatetime() {
        return gmtDatetime;
    }

    public void setGmtDatetime(Date gmtDatetime) {
        this.gmtDatetime = gmtDatetime;
    }

    public Date getUptDatetime() {
        return uptDatetime;
    }

    public void setUptDatetime(Date uptDatetime) {
        this.uptDatetime = uptDatetime;
    }


    public OpenArea getOpenArea() {
        return openArea;
    }

    public void setOpenArea(OpenArea openArea) {
        this.openArea = openArea;
    }
}
